Skip to content

Apple framework for iOS / Unity#203

Open
CoreyKaylor wants to merge 1 commit into
lmdbv1from
ios-unity
Open

Apple framework for iOS / Unity#203
CoreyKaylor wants to merge 1 commit into
lmdbv1from
ios-unity

Conversation

@CoreyKaylor

@CoreyKaylor CoreyKaylor commented Jul 5, 2026

Copy link
Copy Markdown
Owner

▎ Note: This PR is based on the lmdbv1 branch and should merge after that PR lands. The diff shown includes those commits until then.

Fixes #201

@p-lindberg — before merging I'd like to confirm this actually fixes your Unity release build. Details below on what changed and how to test.

What changed

All of it is in the native build/packaging script plus docs — no new dependencies, no managed-code changes (DllImport("lmdb") stays as-is):

  • iOS targets now build with -miphoneos-version-min=12.0 / -mios-simulator-version-min=12.0 (the arm64 simulator slice floors to 14.0 — the toolchain enforces that, since arm64 simulators didn't exist before iOS 14)
  • The dylibs in runtimes/ios-*/native/ are renamed lmdb.dylib (matching the macOS convention and the P/Invoke name), carry an @rpath/lmdb.dylib install name, and are ad-hoc signed. For .NET-for-iOS/MAUI apps these should now work automatically — the SDK embeds and re-signs them at app build time.
  • New: the nupkg now ships ios/lmdb.xcframework — device lmdb.framework + fat (arm64+x86_64) simulator lmdb.framework, each with a proper Info.plist, @rpath/lmdb.framework/lmdb install name, and ad-hoc signature. This is the artifact intended for Unity/Xcode pipelines.
  • The build script now asserts install names, min OS versions, signatures, and simulator archs on every run, so these can't silently regress.

How to test (Unity)

  1. Grab lmdb.xcframework — either from src/LightningDB/ios/ on this branch, or by extracting ios/lmdb.xcframework from the packed nupkg (a nupkg is a zip)
  2. Copy it into Assets/Plugins/iOS (Unity 2021.3+ imports xcframeworks directly; on older versions use the ios-arm64/lmdb.framework slice alone)
  3. In the plugin importer, enable iOS and "Add to Embedded Binaries" so Xcode embeds and re-signs the framework during the app build
  4. The interesting case is a Release / App Store archive — that's where the bare unsigned dylib previously failed

If IL2CPP fails to resolve DllImport("lmdb") against the embedded framework in your Unity version, or anything else doesn't line up with your setup, please report back.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant